<!--
 * @Author: chenl
 * @Date: 2024-03-04 17:20:10
 * @LastEditors: chenl
 * @LastEditTime: 2024-03-08 10:18:17
 * @Description: 
-->
<template>
  <div>
    <el-dialog width="500px" @close="close" :title="title" :visible.sync="showdialog">
      <div class="message-margin">
        {{ message }}
      </div>
      <el-row>
        <el-col :span="16">
          <el-select
            v-model="value"
            filterable
            placeholder="请选择"
            size="mini"
            style="width: 100%"
          >
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-col>
      </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="handleMethods('close', $event)">取 消</el-button>
        <el-button size="mini" type="primary" @click="handleMethods('changeSure', $event)"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: 'ChangeDialog',
  props: {
    message: {
      type: String,
      default: '',
    },
    dialogFormVisible: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default: '',
    },
    options: {
      type: Array,
      default: () => [],
    },
  },

  data() {
    return {
      showdialog: false,
      value: '',
    };
  },
  components: {},
  watch: {
    dialogFormVisible: {
      handler(newval) {
        this.showdialog = newval;
      },
    },
  },
  computed: {},
  created() {},
  mounted() {},
  methods: {
    /**
     * @file 事件回调函数
     * @param
     *
     * @return
     * */
    handleMethods(methodName) {
      this.$emit(methodName, this.value);
    },
    close() {
      this.value = '';
      this.handleMethods('close', false);
    },
  },
};
</script>
<style lang="scss" scoped>
.message-margin {
  margin-bottom: 10px;
}
</style>
